cmake_minimum_required(VERSION 2.8)
project(CustomServerApplication)


###########################设置依赖##########################
set(COMMON_LIB_PATH /opt/cdk)
#poco文件路径
set(POCO_LIB_PATH ${COMMON_LIB_PATH}/poco/v1.6.0)
#taiji路径
set(TAIJI_LIB_PATH ${COMMON_LIB_PATH}/taiji/v1.0)
#gtest路径
set(GTEST_LIB_PATH ${COMMON_LIB_PATH}/gtest/v1.8.0)

include_directories(
        ${POCO_LIB_PATH}/include
        ${TAIJI_LIB_PATH}/include
        ${GTEST_LIB_PATH}/include
)
link_directories(
        ${POCO_LIB_PATH}/lib
        ${TAIJI_LIB_PATH}/lib
        ${GTEST_LIB_PATH}/lib
)


############################设置生成规则############################
#c++11 支持
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
    message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()



set(SOURCE_FILES
        main.cpp
        Application/CustomServerApplication.cpp
        Application/CustomServerApplication.h
        Application/AppLog.cpp Application/AppLog.h)

add_executable(${PROJECT_NAME} ${SOURCE_FILES})


target_link_libraries(${PROJECT_NAME}
        PocoFoundation
        PocoUtil
        PocoNet
        PocoJSON
        TaijiUtil
        pthread)
